Optimal. Leaf size=491 \[ -\frac{b n \text{PolyLog}\left (2,-\frac{\sqrt{g} (d+e x)}{e \sqrt{-f}-d \sqrt{g}}\right )}{4 \sqrt{-f} g^{3/2}}+\frac{b n \text{PolyLog}\left (2,\frac{\sqrt{g} (d+e x)}{d \sqrt{g}+e \sqrt{-f}}\right )}{4 \sqrt{-f} g^{3/2}}+\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}-\sqrt{g} x\right )}-\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}+\sqrt{g} x\right )}+\frac{\log \left (\frac{e \left (\sqrt{-f}-\sqrt{g} x\right )}{d \sqrt{g}+e \sqrt{-f}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{4 \sqrt{-f} g^{3/2}}-\frac{\log \left (\frac{e \left (\sqrt{-f}+\sqrt{g} x\right )}{e \sqrt{-f}-d \sqrt{g}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{4 \sqrt{-f} g^{3/2}}+\frac{b e n \log (d+e x)}{4 g^{3/2} \left (e \sqrt{-f}-d \sqrt{g}\right )}-\frac{b e n \log (d+e x)}{4 g^{3/2} \left (d \sqrt{g}+e \sqrt{-f}\right )}+\frac{b e n \log \left (\sqrt{-f}-\sqrt{g} x\right )}{4 g^{3/2} \left (d \sqrt{g}+e \sqrt{-f}\right )}-\frac{b e n \log \left (\sqrt{-f}+\sqrt{g} x\right )}{4 g^{3/2} \left (e \sqrt{-f}-d \sqrt{g}\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.759976, antiderivative size = 491, normalized size of antiderivative = 1., number of steps used = 28, number of rules used = 10, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.37, Rules used = {288, 205, 2416, 2409, 2395, 36, 31, 2394, 2393, 2391} \[ -\frac{b n \text{PolyLog}\left (2,-\frac{\sqrt{g} (d+e x)}{e \sqrt{-f}-d \sqrt{g}}\right )}{4 \sqrt{-f} g^{3/2}}+\frac{b n \text{PolyLog}\left (2,\frac{\sqrt{g} (d+e x)}{d \sqrt{g}+e \sqrt{-f}}\right )}{4 \sqrt{-f} g^{3/2}}+\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}-\sqrt{g} x\right )}-\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}+\sqrt{g} x\right )}+\frac{\log \left (\frac{e \left (\sqrt{-f}-\sqrt{g} x\right )}{d \sqrt{g}+e \sqrt{-f}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{4 \sqrt{-f} g^{3/2}}-\frac{\log \left (\frac{e \left (\sqrt{-f}+\sqrt{g} x\right )}{e \sqrt{-f}-d \sqrt{g}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{4 \sqrt{-f} g^{3/2}}+\frac{b e n \log (d+e x)}{4 g^{3/2} \left (e \sqrt{-f}-d \sqrt{g}\right )}-\frac{b e n \log (d+e x)}{4 g^{3/2} \left (d \sqrt{g}+e \sqrt{-f}\right )}+\frac{b e n \log \left (\sqrt{-f}-\sqrt{g} x\right )}{4 g^{3/2} \left (d \sqrt{g}+e \sqrt{-f}\right )}-\frac{b e n \log \left (\sqrt{-f}+\sqrt{g} x\right )}{4 g^{3/2} \left (e \sqrt{-f}-d \sqrt{g}\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 288
Rule 205
Rule 2416
Rule 2409
Rule 2395
Rule 36
Rule 31
Rule 2394
Rule 2393
Rule 2391
Rubi steps
\begin{align*} \int \frac{x^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{\left (f+g x^2\right )^2} \, dx &=\int \left (-\frac{f \left (a+b \log \left (c (d+e x)^n\right )\right )}{g \left (f+g x^2\right )^2}+\frac{a+b \log \left (c (d+e x)^n\right )}{g \left (f+g x^2\right )}\right ) \, dx\\ &=\frac{\int \frac{a+b \log \left (c (d+e x)^n\right )}{f+g x^2} \, dx}{g}-\frac{f \int \frac{a+b \log \left (c (d+e x)^n\right )}{\left (f+g x^2\right )^2} \, dx}{g}\\ &=\frac{\int \left (\frac{\sqrt{-f} \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f \left (\sqrt{-f}-\sqrt{g} x\right )}+\frac{\sqrt{-f} \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f \left (\sqrt{-f}+\sqrt{g} x\right )}\right ) \, dx}{g}-\frac{f \int \left (-\frac{g \left (a+b \log \left (c (d+e x)^n\right )\right )}{4 f \left (\sqrt{-f} \sqrt{g}-g x\right )^2}-\frac{g \left (a+b \log \left (c (d+e x)^n\right )\right )}{4 f \left (\sqrt{-f} \sqrt{g}+g x\right )^2}-\frac{g \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f \left (-f g-g^2 x^2\right )}\right ) \, dx}{g}\\ &=\frac{1}{4} \int \frac{a+b \log \left (c (d+e x)^n\right )}{\left (\sqrt{-f} \sqrt{g}-g x\right )^2} \, dx+\frac{1}{4} \int \frac{a+b \log \left (c (d+e x)^n\right )}{\left (\sqrt{-f} \sqrt{g}+g x\right )^2} \, dx+\frac{1}{2} \int \frac{a+b \log \left (c (d+e x)^n\right )}{-f g-g^2 x^2} \, dx-\frac{\int \frac{a+b \log \left (c (d+e x)^n\right )}{\sqrt{-f}-\sqrt{g} x} \, dx}{2 \sqrt{-f} g}-\frac{\int \frac{a+b \log \left (c (d+e x)^n\right )}{\sqrt{-f}+\sqrt{g} x} \, dx}{2 \sqrt{-f} g}\\ &=\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}-\sqrt{g} x\right )}-\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}+\sqrt{g} x\right )}+\frac{\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac{e \left (\sqrt{-f}-\sqrt{g} x\right )}{e \sqrt{-f}+d \sqrt{g}}\right )}{2 \sqrt{-f} g^{3/2}}-\frac{\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac{e \left (\sqrt{-f}+\sqrt{g} x\right )}{e \sqrt{-f}-d \sqrt{g}}\right )}{2 \sqrt{-f} g^{3/2}}+\frac{1}{2} \int \left (-\frac{\sqrt{-f} \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f g \left (\sqrt{-f}-\sqrt{g} x\right )}-\frac{\sqrt{-f} \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f g \left (\sqrt{-f}+\sqrt{g} x\right )}\right ) \, dx-\frac{(b e n) \int \frac{\log \left (\frac{e \left (\sqrt{-f}-\sqrt{g} x\right )}{e \sqrt{-f}+d \sqrt{g}}\right )}{d+e x} \, dx}{2 \sqrt{-f} g^{3/2}}+\frac{(b e n) \int \frac{\log \left (\frac{e \left (\sqrt{-f}+\sqrt{g} x\right )}{e \sqrt{-f}-d \sqrt{g}}\right )}{d+e x} \, dx}{2 \sqrt{-f} g^{3/2}}-\frac{(b e n) \int \frac{1}{(d+e x) \left (\sqrt{-f} \sqrt{g}-g x\right )} \, dx}{4 g}+\frac{(b e n) \int \frac{1}{(d+e x) \left (\sqrt{-f} \sqrt{g}+g x\right )} \, dx}{4 g}\\ &=\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}-\sqrt{g} x\right )}-\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}+\sqrt{g} x\right )}+\frac{\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac{e \left (\sqrt{-f}-\sqrt{g} x\right )}{e \sqrt{-f}+d \sqrt{g}}\right )}{2 \sqrt{-f} g^{3/2}}-\frac{\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac{e \left (\sqrt{-f}+\sqrt{g} x\right )}{e \sqrt{-f}-d \sqrt{g}}\right )}{2 \sqrt{-f} g^{3/2}}+\frac{\int \frac{a+b \log \left (c (d+e x)^n\right )}{\sqrt{-f}-\sqrt{g} x} \, dx}{4 \sqrt{-f} g}+\frac{\int \frac{a+b \log \left (c (d+e x)^n\right )}{\sqrt{-f}+\sqrt{g} x} \, dx}{4 \sqrt{-f} g}+\frac{(b n) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{\sqrt{g} x}{e \sqrt{-f}-d \sqrt{g}}\right )}{x} \, dx,x,d+e x\right )}{2 \sqrt{-f} g^{3/2}}-\frac{(b n) \operatorname{Subst}\left (\int \frac{\log \left (1-\frac{\sqrt{g} x}{e \sqrt{-f}+d \sqrt{g}}\right )}{x} \, dx,x,d+e x\right )}{2 \sqrt{-f} g^{3/2}}+\frac{\left (b e^2 n\right ) \int \frac{1}{d+e x} \, dx}{4 \left (e \sqrt{-f}-d \sqrt{g}\right ) g^{3/2}}-\frac{\left (b e^2 n\right ) \int \frac{1}{d+e x} \, dx}{4 \left (e \sqrt{-f}+d \sqrt{g}\right ) g^{3/2}}-\frac{(b e n) \int \frac{1}{\sqrt{-f} \sqrt{g}+g x} \, dx}{4 \left (e \sqrt{-f}-d \sqrt{g}\right ) \sqrt{g}}-\frac{(b e n) \int \frac{1}{\sqrt{-f} \sqrt{g}-g x} \, dx}{4 \left (e \sqrt{-f}+d \sqrt{g}\right ) \sqrt{g}}\\ &=\frac{b e n \log (d+e x)}{4 \left (e \sqrt{-f}-d \sqrt{g}\right ) g^{3/2}}-\frac{b e n \log (d+e x)}{4 \left (e \sqrt{-f}+d \sqrt{g}\right ) g^{3/2}}+\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}-\sqrt{g} x\right )}-\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}+\sqrt{g} x\right )}+\frac{b e n \log \left (\sqrt{-f}-\sqrt{g} x\right )}{4 \left (e \sqrt{-f}+d \sqrt{g}\right ) g^{3/2}}+\frac{\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac{e \left (\sqrt{-f}-\sqrt{g} x\right )}{e \sqrt{-f}+d \sqrt{g}}\right )}{4 \sqrt{-f} g^{3/2}}-\frac{b e n \log \left (\sqrt{-f}+\sqrt{g} x\right )}{4 \left (e \sqrt{-f}-d \sqrt{g}\right ) g^{3/2}}-\frac{\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac{e \left (\sqrt{-f}+\sqrt{g} x\right )}{e \sqrt{-f}-d \sqrt{g}}\right )}{4 \sqrt{-f} g^{3/2}}-\frac{b n \text{Li}_2\left (-\frac{\sqrt{g} (d+e x)}{e \sqrt{-f}-d \sqrt{g}}\right )}{2 \sqrt{-f} g^{3/2}}+\frac{b n \text{Li}_2\left (\frac{\sqrt{g} (d+e x)}{e \sqrt{-f}+d \sqrt{g}}\right )}{2 \sqrt{-f} g^{3/2}}+\frac{(b e n) \int \frac{\log \left (\frac{e \left (\sqrt{-f}-\sqrt{g} x\right )}{e \sqrt{-f}+d \sqrt{g}}\right )}{d+e x} \, dx}{4 \sqrt{-f} g^{3/2}}-\frac{(b e n) \int \frac{\log \left (\frac{e \left (\sqrt{-f}+\sqrt{g} x\right )}{e \sqrt{-f}-d \sqrt{g}}\right )}{d+e x} \, dx}{4 \sqrt{-f} g^{3/2}}\\ &=\frac{b e n \log (d+e x)}{4 \left (e \sqrt{-f}-d \sqrt{g}\right ) g^{3/2}}-\frac{b e n \log (d+e x)}{4 \left (e \sqrt{-f}+d \sqrt{g}\right ) g^{3/2}}+\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}-\sqrt{g} x\right )}-\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}+\sqrt{g} x\right )}+\frac{b e n \log \left (\sqrt{-f}-\sqrt{g} x\right )}{4 \left (e \sqrt{-f}+d \sqrt{g}\right ) g^{3/2}}+\frac{\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac{e \left (\sqrt{-f}-\sqrt{g} x\right )}{e \sqrt{-f}+d \sqrt{g}}\right )}{4 \sqrt{-f} g^{3/2}}-\frac{b e n \log \left (\sqrt{-f}+\sqrt{g} x\right )}{4 \left (e \sqrt{-f}-d \sqrt{g}\right ) g^{3/2}}-\frac{\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac{e \left (\sqrt{-f}+\sqrt{g} x\right )}{e \sqrt{-f}-d \sqrt{g}}\right )}{4 \sqrt{-f} g^{3/2}}-\frac{b n \text{Li}_2\left (-\frac{\sqrt{g} (d+e x)}{e \sqrt{-f}-d \sqrt{g}}\right )}{2 \sqrt{-f} g^{3/2}}+\frac{b n \text{Li}_2\left (\frac{\sqrt{g} (d+e x)}{e \sqrt{-f}+d \sqrt{g}}\right )}{2 \sqrt{-f} g^{3/2}}-\frac{(b n) \operatorname{Subst}\left (\int \frac{\log \left (1+\frac{\sqrt{g} x}{e \sqrt{-f}-d \sqrt{g}}\right )}{x} \, dx,x,d+e x\right )}{4 \sqrt{-f} g^{3/2}}+\frac{(b n) \operatorname{Subst}\left (\int \frac{\log \left (1-\frac{\sqrt{g} x}{e \sqrt{-f}+d \sqrt{g}}\right )}{x} \, dx,x,d+e x\right )}{4 \sqrt{-f} g^{3/2}}\\ &=\frac{b e n \log (d+e x)}{4 \left (e \sqrt{-f}-d \sqrt{g}\right ) g^{3/2}}-\frac{b e n \log (d+e x)}{4 \left (e \sqrt{-f}+d \sqrt{g}\right ) g^{3/2}}+\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}-\sqrt{g} x\right )}-\frac{a+b \log \left (c (d+e x)^n\right )}{4 g^{3/2} \left (\sqrt{-f}+\sqrt{g} x\right )}+\frac{b e n \log \left (\sqrt{-f}-\sqrt{g} x\right )}{4 \left (e \sqrt{-f}+d \sqrt{g}\right ) g^{3/2}}+\frac{\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac{e \left (\sqrt{-f}-\sqrt{g} x\right )}{e \sqrt{-f}+d \sqrt{g}}\right )}{4 \sqrt{-f} g^{3/2}}-\frac{b e n \log \left (\sqrt{-f}+\sqrt{g} x\right )}{4 \left (e \sqrt{-f}-d \sqrt{g}\right ) g^{3/2}}-\frac{\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac{e \left (\sqrt{-f}+\sqrt{g} x\right )}{e \sqrt{-f}-d \sqrt{g}}\right )}{4 \sqrt{-f} g^{3/2}}-\frac{b n \text{Li}_2\left (-\frac{\sqrt{g} (d+e x)}{e \sqrt{-f}-d \sqrt{g}}\right )}{4 \sqrt{-f} g^{3/2}}+\frac{b n \text{Li}_2\left (\frac{\sqrt{g} (d+e x)}{e \sqrt{-f}+d \sqrt{g}}\right )}{4 \sqrt{-f} g^{3/2}}\\ \end{align*}
Mathematica [A] time = 0.88159, size = 383, normalized size = 0.78 \[ \frac{\frac{b f n \text{PolyLog}\left (2,-\frac{\sqrt{g} (d+e x)}{e \sqrt{-f}-d \sqrt{g}}\right )}{(-f)^{3/2}}+\frac{b n \text{PolyLog}\left (2,\frac{\sqrt{g} (d+e x)}{d \sqrt{g}+e \sqrt{-f}}\right )}{\sqrt{-f}}+\frac{\log \left (\frac{e \left (\sqrt{-f}-\sqrt{g} x\right )}{d \sqrt{g}+e \sqrt{-f}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{\sqrt{-f}}+\frac{f \log \left (\frac{e \left (\sqrt{-f}+\sqrt{g} x\right )}{e \sqrt{-f}-d \sqrt{g}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{(-f)^{3/2}}+\frac{a+b \log \left (c (d+e x)^n\right )}{\sqrt{-f}-\sqrt{g} x}-\frac{a+b \log \left (c (d+e x)^n\right )}{\sqrt{-f}+\sqrt{g} x}-\frac{b e n \left (\log (d+e x)-\log \left (\sqrt{-f}-\sqrt{g} x\right )\right )}{d \sqrt{g}+e \sqrt{-f}}+\frac{b e n \left (\log (d+e x)-\log \left (\sqrt{-f}+\sqrt{g} x\right )\right )}{e \sqrt{-f}-d \sqrt{g}}}{4 g^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.619, size = 1781, normalized size = 3.6 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{b x^{2} \log \left ({\left (e x + d\right )}^{n} c\right ) + a x^{2}}{g^{2} x^{4} + 2 \, f g x^{2} + f^{2}}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )} x^{2}}{{\left (g x^{2} + f\right )}^{2}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]